Skip to content

Conversation

folkertdev
Copy link
Contributor

Description

Add qsort_r for apple, freebsd and netbsd targets, and qsort and qsort_s for windows targets.

Sources

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot
Copy link
Collaborator

rustbot commented Aug 28, 2025

Some changes occurred in OpenBSD module

cc @semarie

@semarie
Copy link
Contributor

semarie commented Aug 29, 2025 via email

@folkertdev
Copy link
Contributor Author

Sure, I moved the definition to src/unix/bsd/netbsdlike/netbsd/mod.rs, and I believe the semver entry was already correct.

@collinfunk
Copy link
Contributor

There is also a seperate and incompatible API that exists on older versions of FreeBSD before it was changed in 14.0 [1] [2]. Not sure if that needs to be handled here.

[1] https://www.gnu.org/software/gnulib/manual/html_node/qsort_005fr.html
[2] https://man.freebsd.org/cgi/man.cgi?query=qsort_r

@folkertdev
Copy link
Contributor Author

Right, fun, the argument order of the function pointer is swapped in those earlier versions

https://man.freebsd.org/cgi/man.cgi?query=qsort_r&manpath=FreeBSD+13.4-RELEASE

I've fixed that by moving the correct definition into src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs and so on.

Copy link
Contributor

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR is ok now. HOWEVER, I would like to wait to merge it until after #4685, #4690, and #4691 are resolved. The we can rebase this PR, and see if CI passes on FreeBSD.

@folkertdev
Copy link
Contributor Author

Well freebsd CI is happy now (all those 3 PRs got merged). Seems like something else is failing, I don't think that's due to this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants